(function() {
    'use strict';

    var css = {
        'jquery-cropper': 'css!lib/jquery-cropper/css/cropper',
        'bootstrap-datepicker': 'css!lib/bootstrap-datepicker/css/bootstrap-datepicker',
        'angular-ngDialog': 'css!lib/angular-ngDialog/css/ngDialog',
        'angular-ngDialog-theme': 'css!lib/angular-ngDialog/css/ngDialog-theme-default',
        'angular-ngTable': 'css!lib/angular-ngTable/css/ng-table',
        'angular-ngImgCrop': 'css!lib/angular-ngImgCrop/css/ng-img-crop'
    };

    require.config({
        baseUrl: '',
        map: {
            '*': { 'css': 'css' }
        },
        stickCss: 'main-css-fixed',
        paths: {
            'jquery': 'lib/jquery/jquery',
            'jquery-cropper': 'lib/jquery-cropper/js/cropper',
            'underscore': 'lib/underscore/underscore',
            'bootstrap': 'lib/bootstrap/js/bootstrap',
            'bootstrap-datepicker': 'lib/bootstrap-datepicker/js/bootstrap-datepicker',
            'bootstrap-datepicker.zh-CN': 'lib/bootstrap-datepicker/js/bootstrap-datepicker.zh-CN',
            'angular': 'lib/angular/angular',
            'angularAMD': 'lib/angularAMD/angularAMD',
            'angular-ui-bootstrap': 'lib/angular-ui-bootstrap/ui-bootstrap-tpls',
            'angular-animate': 'lib/angular/angular-animate',
            'angular-route': 'lib/angular/angular-route',
            'angular-cookies': 'lib/angular/angular-cookies',
            'angular-sanitize': 'lib/angular/angular-sanitize',
            'angular-ngDialog': 'lib/angular-ngDialog/js/ngDialog',
            'angular-ngTable': 'lib/angular-ngTable/js/ng-table',
            'angular-ngImgCrop': 'lib/angular-ngImgCrop/js/ng-img-crop',
            'angular-ngFileUpload': 'lib/angular-ngFileUpload/ng-file-upload',
            'angular-ngFileUpload-shim': 'lib/angular-ngFileUpload/ng-file-upload-shim'
        },
        shim: {
            'jquery': { exports: 'jQuery' },
            'jquery-cropper': ['jquery', css['jquery-cropper']],
            'bootstrap': ['jquery'],
            'bootstrap-datepicker': ['bootstrap', css['bootstrap-datepicker']],
            'bootstrap-datepicker.zh-CN': ['bootstrap-datepicker'],
            'angular': { deps: ['jquery'], exports: 'angular' },
            'angularAMD': ['angular'],
            'angular-ui-bootstrap': ['angular', 'bootstrap', 'angular-animate'],
            'angular-animate': ['angular'],
            'angular-route': ['angular'],
            'angular-cookies': ['angular'],
            'angular-sanitize': ['angular'],
            'angular-ngDialog': ['angular', css['angular-ngDialog'], css['angular-ngDialog-theme']],
            'angular-ngTable': ['angular', css['angular-ngTable']],
            'angular-ngImgCrop': ['angular', css['angular-ngImgCrop']],
            'angular-ngFileUpload': ['angular', 'angular-ngFileUpload-shim'],
            'app': ['angular', 'bootstrap']
        },
        deps: ['app'],
        waitSeconds: 0
    });
})();
